const { Schema, model } = require('mongoose');
// 1. 设置集合结构
const studentsSchema = new Schema({
    name: String,
    age: String,
    gender: String,
    subjectsId: {
        type: Schema.Types.ObjectId,
        ref: 'subjectsModel'
    },
    classesId: {
        type: Schema.Types.ObjectId,
        ref: 'classesModel'
    },
    imagePath: String
    // isDelete: {
    //     type: Boolean,
    //     default: true
    // }
}, { versionKey: false });
// 2. 设置数据模型，同时连接数据集合
module.exports.studentsModel = model('studentsModel', studentsSchema, 'students');